﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.master" AutoEventWireup="true"
    CodeFile="EditNewsSection.aspx.cs" Inherits="Admin_EditNewsSection" ValidateRequest="false" %>

<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <table class="innerContent" width="100%" cellpadding="0" cellspacing="0">
        <tr>
            <td>
                <img src="Images/img-table-1.gif" />
            </td>
            <td width="100%" class="table-bg-1">
            </td>
            <td>
                <img src="Images/img-table-2.gif" />
            </td>
        </tr>
        <tr>
            <td class="table-bg-2">
                &nbsp;
            </td>
            <td>
                <div class="heading">
                    <img src="Images/img-heading-box.gif" align="absmiddle" />
                    &nbsp; Manage News Section</div>
                <div class="strip">
                </div>
                <br />
                <br />
                <table cellpadding="5" width="100%">
                    <tr>
                        <td colspan="2">
                            <asp:Label runat="server" ID="lblError" CssClass="failureNotification">
                            </asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            Select Item*:
                        </td>
                        <td>
                            <asp:DropDownList ID="ddlNews" runat="server">
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            Title*:
                        </td>
                        <td>
                            <asp:TextBox runat="server" ID="txtTitle" Width="230" MaxLength="50" CssClass="textboxcss"></asp:TextBox>
                            <%--<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtTitle"
                                Display="Dynamic" ValidationGroup="EditNews" ErrorMessage="Title is required"
                                CssClass="failureNotification">*</asp:RequiredFieldValidator>--%>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            Description*:
                        </td>
                        <td>
                            <FCKeditorV2:FCKeditor ID="FCKeditor" runat="server" Height="400px" BasePath="~/fckeditor/">
                            </FCKeditorV2:FCKeditor>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            &nbsp;
                        </td>
                        <td align="left">
                            <asp:Button runat="server" ID="btnSubmit" ValidationGroup="EditNews" Text="Submit"
                                OnClick="btnSubmit_Click" />
                            <asp:Button runat="server" Visible="false" ID="btnUpdate" ValidationGroup="EditNews"
                                Text="Update" OnClick="btnUpdate_Click" />
                            <asp:ValidationSummary ID="ValidationSummary1" runat="server" ValidationGroup="EditNews"
                                ShowMessageBox="true" ShowSummary="false" />
                            <asp:HiddenField runat="server" ID="hidId" />
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <asp:GridView ID="grvNewsSection" HorizontalAlign="Center" CellPadding="5" runat="server"
                                AutoGenerateColumns="False" AllowPaging="true" PageSize="10" CssClass="grdv-style"
                                DataKeyNames="Id" EmptyDataText="Sorry! No Records found." OnPageIndexChanging="grvNewsSection_PageIndexChanging"
                                OnRowCommand="grvNewsSection_RowCommand" OnRowUpdating="grvNewsSection_RowUpdating"
                                OnRowDeleting="grvNewsSection_RowDeleting">
                                <Columns>
                                    <asp:TemplateField HeaderText="Title">
                                        <ItemTemplate>
                                            <asp:HiddenField ID="hdnSelectedItem" runat="server" Value='<%#Eval("Tag")%>' />
                                            <asp:Label ID="lblTitle" Width="150px" runat="server" Text='<%#Eval("Title")%>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Description">
                                        <ItemTemplate>
                                         <div id="dvDescription"  style="overflow:auto;width:230px; height:100px;vertical-align:middle;"> 
                                            <asp:Label ID="lblDescription" runat="server" Text='<%#Eval("Description")%>'
                                                ></asp:Label>
                                         </div>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Section">
                                        <ItemTemplate>
                                            <asp:Label ID="lblTag" Width="70px" runat="server" Text='<%# Enum.GetName(typeof(Sylvain.Manager.Tag),Convert.ToInt32(Eval("Tag"))) %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Delete">
                                        <ItemTemplate>
                                            <asp:LinkButton ID="lnkDelete" runat="server" Text="Delete" CommandName="Delete"
                                                OnClientClick="return confirm('Are you sure to delete this Record?');" CommandArgument='<%#Eval("Id")%>'></asp:LinkButton>
                                            <asp:LinkButton ID="lnkEdit" runat="server" Text="Edit" CommandName="Update" CommandArgument='<%#Eval("Id")%>'></asp:LinkButton>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <%--<asp:TemplateField HeaderText="Edit">
                            <ItemTemplate>
                                <asp:LinkButton ID="lnkEdit" Width="80px" runat="server" Text="Edit" CommandName="Update" CommandArgument='<%#Eval("ProductID")%>'></asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>--%>
                                </Columns>
                                <HeaderStyle CssClass="grdv-header-style" />
                                <RowStyle CssClass="grdv-row-style" />
                                <AlternatingRowStyle CssClass="grdv-altrow-style" />
                                <FooterStyle CssClass="grdv-footer-style" />
                                <PagerStyle CssClass="grdv-pager-style" />
                                <EmptyDataRowStyle CssClass="grdv-empty-style" />
                            </asp:GridView>
                        </td>
                    </tr>
                </table>
                <br />
                <br />
                <div class="cl">
                </div>
            </td>
            <td class="table-bg-3">
                &nbsp;
            </td>
        </tr>
        <tr>
            <td>
                <img src="Images/img-table-3.gif" />
            </td>
            <td class="table-bg-4">
            </td>
            <td>
                <img src="Images/img-table-4.gif" />
            </td>
        </tr>
    </table>
</asp:Content>
